﻿using UnityEngine;
using System.Collections;
#if UNITY_EDITOR
using UnityEditor;
#endif
using System;

[Serializable]
public class BTFloatNode : BTNodeBase
{

    public float nodeValue;
    public BTEditorNodeOutput output;

    #region Constrcutor
    public BTFloatNode()
    {
        output = new BTEditorNodeOutput();
    }
    #endregion

    public override void InitNode()
    {
        base.InitNode();
       // nodeType = NodeType.Float;
        nodeRect = new Rect(10f, 10f, 150f, 65f);
    }

    public override void UpdateNode(Event e, Rect viewRect)
    {
        base.UpdateNode(e, viewRect);
    }

#if UNITY_EDITOR
    public override void UpdateNodeGUI(Event e, Rect viewRect, GUISkin viewSkin)
    {
        base.UpdateNodeGUI(e, viewRect, viewSkin);


        if (GUI.Button(new Rect(nodeRect.x + nodeRect.width, nodeRect.y + 5f, btnEditHeigh, btnEditHeigh), 
                        new GUIContent(),viewSkin.GetStyle("NodeAddNormal")))
        {
            if(parentGraph != null)
            {
                parentGraph.wantsConnection = true;
                parentGraph.connectionNode = this;
            }
        }
    }

    public override void DrawNodeProperties()
    {
        base.DrawNodeProperties();

    }
#endif
}
